import Vue from 'vue'
import VueRouter from 'vue-router'
Vue.use(VueRouter)
import Login from '@/views/Admin/Login.vue';
import Register from '@/views/Admin/Register.vue';
import LayOut from '@/components/LayOut.vue';
const routes = [
	// {
	//   path: '/',
	//   name: 'Home',
	//   component: Home
	// },
	{
		path: '/login',
		alias: '/', //别名
		name: 'Login',
		component: Login,
	},
	{
		path: '/register',
		name: 'Register',
		component: Register,
	},
	{
		path: '/admin',
		name: 'Admin',
		component: LayOut,
		// meta: { requiresAuth: true },
		// children: [{
		// 		path: 'list',
		// 		name: 'AdminList',
		// 		component: () => import('@/views/Admin/List.vue')
		// 	},
		// 	{
		// 		path: 'edit/:id',
		// 		name: 'AdminEdit',
		// 		component: () => import('@/views/Admin/Edit.vue'),
		// 		props: true,
		// 	},
		// 	{
		// 		path: 'info',
		// 		name: 'AdminInfo',
		// 		component: () => import('@/views/Admin/Info.vue'),
		// 		props: true,
		// 	}
		// ]
	},
	{
		path: '/goods',
		name: 'Goods',
		component: LayOut,
		meta: { requiresAuth: true },
		children: [{
				path: 'category',
				name: 'GoodsCategory',
				component: () => import('@/views/Goods/Category.vue')
			},
			{
				path: 'list',
				name: 'GoodsList',
				component: () => import('@/views/Goods/List.vue')
			},
			{
				path: 'release',
				name: 'GoodsRelease',
				component: () => import('@/views/Goods/Release.vue')
			},
			{
				path: 'edit/:id',
				name: 'GoodsEdit',
				component: () => import('@/views/Goods/Edit.vue'),
				props: true,
			},
			// {
			// 	path: 'info',
			// 	name: 'AdminInfo',
			// 	component: () => import('@/views/Admin/Info.vue'),
			// 	props: true,
			// }
		]
	},
	{
		path: '/auth',
		name: 'Auth',
		component: LayOut,
		meta: { requiresAuth: true },
		children: [{
				path: 'role',
				name: 'AuthRole',
				component: () => import('@/views/Auth/Role.vue'),
				
			},
			{
				path: 'menu',
				name: 'AuthMenu',
				component: () => import('@/views/Auth/Menu.vue')
			},
			{
				path: 'role/config/:id',
				name: 'AuthRoleConfig',
				component: () => import('@/views/Auth/RoleConfig.vue')
			},
			// {
			// 	path: 'edit/:id',
			// 	name: 'AdminEdit',
			// 	component: () => import('@/views/Admin/Edit.vue'),
			// 	props: true,
			// },
			// {
			// 	path: 'info',
			// 	name: 'AdminInfo',
			// 	component: () => import('@/views/Admin/Info.vue'),
			// 	props: true,
			// }
		]
	}, {
		path: '/user',
		name: 'User',
		component: LayOut,
		meta: { requiresAuth: true },
		children: [{
				path: 'list',
				name: 'UserList',
				component: () => import('@/views/User/List.vue')
			},
			{
				path: 'info',
				name: 'UserInfo',
				component: () => import('@/views/User/Info.vue')
			},
			//{
			// 	path: 'release',
			// 	name: 'GoodsRelease',
			// 	component: () => import('@/views/Goods/Release.vue')
			// },
			// {
			// 	path: 'edit/:id',
			// 	name: 'AdminEdit',
			// 	component: () => import('@/views/Admin/Edit.vue'),
			// 	props: true,
			// },
			// {
			// 	path: 'info',
			// 	name: 'AdminInfo',
			// 	component: () => import('@/views/Admin/Info.vue'),
			// 	props: true,
			// }
		],
	},
	{
		path: '/order',
		name: 'Order',
		component: LayOut,
		meta: { requiresAuth: true },
		children: [{
				path: 'list',
				name: 'OrderList',
				component: () => import('@/views/Order/List.vue')
			},
			// {
			// 	path: 'info',
			// 	name: 'UserInfo',
			// 	component: () => import('@/views/User/Info.vue')
			// },
			//{
			// 	path: 'release',
			// 	name: 'GoodsRelease',
			// 	component: () => import('@/views/Goods/Release.vue')
			// },
			// {
			// 	path: 'edit/:id',
			// 	name: 'AdminEdit',
			// 	component: () => import('@/views/Admin/Edit.vue'),
			// 	props: true,
			// },
			// {
			// 	path: 'info',
			// 	name: 'AdminInfo',
			// 	component: () => import('@/views/Admin/Info.vue'),
			// 	props: true,
			// }
		],
	},
]

const router = new VueRouter({
	routes
})

export default router
